package com.ruoyi.cloudpc.service.impl;

import java.util.List;

import com.ruoyi.cloudpc.domain.CloudWithdrawal;
import com.ruoyi.cloudpc.mapper.CloudWithdrawalMapper;
import com.ruoyi.cloudpc.service.ICloudWithdrawalService;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 提现记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-20
 */
@Service
public class CloudWithdrawalServiceImpl implements ICloudWithdrawalService
{
    @Autowired
    private CloudWithdrawalMapper cloudWithdrawalMapper;

    /**
     * 查询提现记录
     * 
     * @param id 提现记录主键
     * @return 提现记录
     */
    @Override
    public CloudWithdrawal selectCloudWithdrawalById(String id)
    {
        return cloudWithdrawalMapper.selectCloudWithdrawalById(id);
    }

    /**
     * 查询提现记录列表
     * 
     * @param cloudWithdrawal 提现记录
     * @return 提现记录
     */
    @DataScope(userAlias = "u", permission = "common")
    @Override
    public List<CloudWithdrawal> selectCloudWithdrawalList(CloudWithdrawal cloudWithdrawal)
    {
        return cloudWithdrawalMapper.selectCloudWithdrawalList(cloudWithdrawal);
    }

    /**
     * 新增提现记录
     * 
     * @param cloudWithdrawal 提现记录
     * @return 结果
     */
    @Override
    public int insertCloudWithdrawal(CloudWithdrawal cloudWithdrawal)
    {
        cloudWithdrawal.setCreateByAndTime();
        return cloudWithdrawalMapper.insertCloudWithdrawal(cloudWithdrawal);
    }

    /**
     * 修改提现记录
     * 
     * @param cloudWithdrawal 提现记录
     * @return 结果
     */
    @Override
    public int updateCloudWithdrawal(CloudWithdrawal cloudWithdrawal)
    {
        cloudWithdrawal.setUpdateByAndTime();
        return cloudWithdrawalMapper.updateCloudWithdrawal(cloudWithdrawal);
    }

    /**
     * 批量删除提现记录
     * 
     * @param ids 需要删除的提现记录主键
     * @return 结果
     */
    @Override
    public int deleteCloudWithdrawalByIds(String[] ids)
    {
        return cloudWithdrawalMapper.deleteCloudWithdrawalByIds(ids);
    }

    /**
     * 删除提现记录信息
     * 
     * @param id 提现记录主键
     * @return 结果
     */
    @Override
    public int deleteCloudWithdrawalById(String id)
    {
        return cloudWithdrawalMapper.deleteCloudWithdrawalById(id);
    }
}
